﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DDD.Core;

namespace DDDTest.Core {
    [TestClass]
    public class TestActiveInterval {
        [TestMethod]
        public void Test_New () {
            var ai = new ActiveInterval (100, 200);

            Assert.AreEqual(100, ai.Start);
            Assert.AreEqual(200, ai.End);
        }

        [TestMethod]
        public void Test_GetActiveInterval () {
            var ai = new ActiveInterval (100, 200);
            Assert.AreEqual (100, ai.GetActiveStart (50));
            Assert.AreEqual (150, ai.GetActiveStart (150));
            Assert.AreEqual (250, ai.GetActiveStart (250));
            Assert.AreEqual (50, ai.GetActiveEnd (50));
            Assert.AreEqual (150, ai.GetActiveEnd (150));
            Assert.AreEqual (200, ai.GetActiveEnd (250));
        }
    }
}
